﻿using static CyberU;
using static CyberU.UI;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Events;
using System;
using System.Collections.Generic;
public static class Extensions
{
    public static void Deconstruct<T>(this List<T> list, out T a, out T b)
    {
        if (list.Count < 2) throw new ArgumentException("List must have at least 2 elements.");
        a = list[0];
        b = list[1];
    }

    public static void Deconstruct<T>(this List<T> list, out T a, out T b, out T c)
    {
        if (list.Count < 3) throw new ArgumentException("List must have at least 3 elements.");
        a = list[0];
        b = list[1];
        c = list[2];
    }
    public static float GetMain(this ClickTextSelectItem item)
    {
        // Delog($"{item.direction} {item.width} {item.height}");
        return item.direction == "horizontal" ? item.width : item.height;
    }
}